% 手动定义第一条线的坐标
iterations_start = 1;
iterations_end = 1000;
access_rate_start = 0.6;
access_rate_end = 1;

iterations1 = [1, 40, 80, 120, 160, 200, 240, 280, 320, 360, ...
               400, 440, 480, 520, 560, 600, 640, 680, 720, 760, ...
               800, 840, 880, 920, 960, 1000];
average_access_rates1 = [0.66, 0.63, 0.64, 0.64, 0.66, 0.668, 0.668, 0.67, 0.68, 0.669, ...
                         0.67, 0.68, 0.69, 0.69, 0.67, 0.66, 0.67, 0.65, 0.66, 0.67, ...
                         0.66, 0.65, 0.65, 0.66, 0.66, 0.67];
 
% 手动定义第二条线的坐标
iterations2 = iterations1; % 使用相同的迭代次数
average_access_rates2 = [0.64, 0.65, 0.67, 0.64, 0.65, 0.66, 0.65, 0.66, 0.70, 0.78, ...
                         0.82, 0.82, 0.84, 0.82, 0.81, 0.80, 0.80, 0.79, 0.78, 0.80, ...
                         0.81, 0.82, 0.80, 0.80, 0.79, 0.80];
 
% 手动定义第三条线的坐标
iterations3 = iterations1; % 使用相同的迭代次数
average_access_rates3 = [0.67, 0.69, 0.69, 0.697, 0.70, 0.75, 0.771, 0.781, 0.79, 0.80, ...
                         0.84, 0.84, 0.88, 0.89, 0.90, 0.93, 0.92, 0.92, 0.93, 0.921, ...
                         0.91, 0.90, 0.91, 0.92, 0.93, 0.93];
 
% 绘制图形
figure;
plot(iterations1, average_access_rates1, '-o','LineWidth', 2,  'DisplayName', 'DQN');
hold on; % 保持当前图形
plot(iterations2, average_access_rates2, '-s', 'LineWidth', 2,'DisplayName', 'D3QN');
plot(iterations3, average_access_rates3, '-d','LineWidth', 2,  'DisplayName', 'FL-D3QN');
hold off;
 
% 添加标签和图例
xlabel('迭代次数');
ylabel('平均接入率');
title('迭代次数与平均接入率关系图');

legend('show'); % 显示图例